package com.example.oj;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.Data;
import lombok.ToString;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zjianfa
 */
@Data
@ToString
public class FileInfo {
    public boolean spj = false;
    public Map<String, Item> test_cases = new HashMap<>();

    @Data
    public static class Item {
        private String stripped_output_md5;
        private int output_size;
        private String input_name;
        private int input_size;
        private String output_name;

        public Item(String name){
            this.input_name = name + ".in";
            this.output_name = name + ".out";
        }
    }

    public String toJson(){
        return JSON.toJSONString(this, SerializerFeature.PrettyFormat,
                SerializerFeature.WriteNullNumberAsZero,
                SerializerFeature.WriteNullStringAsEmpty);
    }
}
